package com.shop.service.impl;

import com.shop.exception.GlobalException;
import com.shop.mapper.UserMapper;
import com.shop.service.EmailService;
import com.shop.util.EmailUtils;
import jakarta.mail.MessagingException;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author XCH
 * @date 2025 - 06 - 19
 */
@Service("emilService")
@RequiredArgsConstructor
@Transactional(rollbackFor = RuntimeException.class,
        propagation = Propagation.REQUIRED)
public class EmailServiceImpl implements EmailService {

    private final UserMapper userMapper;
    @Override
    public void sendEmail(String email, String authCode) throws MessagingException {
        EmailUtils.sendEmail(email, authCode);


    }
}
